import {Component, OnInit, ViewChild} from '@angular/core';
import {NzModalRef} from 'ng-zorro-antd';
import {_HttpClient} from '@delon/theme';
// import * as CodeMirror from 'codemirror';
// import 'codemirror/mode/sql/sql';
// import 'codemirror/addon/hint/show-hint.js';
// import 'codemirror/addon/hint/sql-hint.js';
// import 'codemirror/addon/display/fullscreen.js';

@Component({
  selector: 'app-message-message-template-add',
  templateUrl: './message-template-add.component.html',
})
export class MessageMessageTemplateAddComponent implements OnInit {
 /* @ViewChild('f') f;
  i: any = {};
  completeAfter;
   cmOptions: any = {
    lineNumbers: true,
    theme: "night",//显示行号
    mode: { name: "text/x-mysql" },          //定义mode
    extraKeys: {
      "F11": function(cm) {
        cm.setOption("fullScreen", !cm.getOption("fullScreen"));
      },
      "Esc": function(cm) {
        if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
      }
    },   //自动提示配置
  };*/

  constructor(
    private modal: NzModalRef,
    public http: _HttpClient,
  ) { }

  ngOnInit(): void {
  }

  save(value: any) {

    this.http.post(`sys/user/add`, value).subscribe(res => {
      this.modal.close(true);
    });
  }

  close() {
    this.modal.destroy();
  }
}
